<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <ul id="list">

  </ul>
  <script>
    const list = document.querySelector('#list')
    fetch('http://localhost:3000/api/list', {
      method: 'GET',
      headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer ' + localStorage.getItem('token')
      }
    }).then(res => res.json()).then(data => {
      data.list.forEach(item => {
        const li = document.createElement('li')
        li.innerText = item.name
        list.appendChild(li)
      })
    })
  </script>
</body>

</html>